
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>父页面</title>
	</head>
	<body>
		<div id="ss" style="width: 400px;height: 400px; background: darkmagenta;">
			<button id="chuancan" onclick="chuandicanshu()">1</button>
		</div>
		
		<div id="main" style="position: fixed;left: 200px;top: 200px;background: red;">
			<iframe id="childFrame" src="iframe_test2.html" width="100" height="100"></iframe>
		</div>
		
		<script type="text/javascript">
			//调用子页面方法
			function chuandicanshu(){
				document.getElementById("childFrame").contentWindow.update("你好");
			}
			function closeParentWindow(){
				document.getElementById("main").style.display = "none";
			}
		</script>
	</body>

